import { ConfigProvider, ConfigProviderThemeVars, NavBar } from 'vant'
import { defineComponent, PropType } from 'vue'
import { useRouter } from 'vue-router'


export default defineComponent({
    props: {
        title: String,
        rightText: String,
        leftArrow: { type: Boolean, default: true },
        onClickRight: { type: Function as PropType<(...args: any[]) => any> }
    },
    setup: (props) => {
        console.log({ props })
        const themeVars: ConfigProviderThemeVars = {
            navBarIconColor: '#A8A8A8'
        }
        const router = useRouter()

        return () => <ConfigProvider themeVars={themeVars}>
            <NavBar onClickLeft={router.back} border={false} {...props} />
        </ConfigProvider>
    }
})